package com.loozb.java8.lambda;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        List<String> names = Arrays.asList("peter", "anna", "mike", "xenia");

        Collections.sort(names, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareTo(o2);
            }
        });

        Collections.sort(names, (String o1, String o2) -> o1.compareTo(o2));

        names.sort((a, b) -> b.compareTo(a));
        System.out.println(names);
    }
}
